<?PHP
  abstract class WidgetBase{
    public $headline           = "";
    public $content            = "";
    public $minwidth           = -1;
    public $maxwidth           = -1;
    public $minheight          = -1;
    public $maxheight          = -1;
    public $displayType        = "default";
    public $allowDisplayRandom = true;
    public $path               = "";

    public function display(){
      $template = new Template();
      $template->load("widget_".$this->displayType);
      $template->assign_var("HEADLINE",$this->headline);
      $template->assign_var("CONTENT",$this->content);
      $template->assign_var("MINWIDTH",$this->minwidth);
      $template->show_if("HASMINWIDTH",$this->minwidth != -1);
      $template->assign_var("MAXWIDTH",$this->maxwidth);
      $template->show_if("HASMAXWIDTH",$this->maxwidth != -1);
      $template->assign_var("MINHEIGHT",$this->miheight);
      $template->show_if("HASMINHEIGHT",$this->minheight != -1);
      $template->assign_var("MAXHEIGHT",$this->maxheight);
      $template->show_if("HASMAXHEIGHT",$this->maxheight != -1);
      $template->output();
    }
    
     public abstract function load();
  }
?>